<template>
  <div>
    <h1 style="font-size: 50px">欢迎{{ name }}</h1>
    <ul>
      <li v-for="i in user">{{i.name}}</li>
    </ul>
  </div>
</template>

<script>
export default {
  name: "userinfo",
  data() {
    return {
      name: localStorage.getItem('name'),
      user: []
    }
  },
  methods: {
    get_user() {
      this.$axios.get('/user/login')
        .then(res => {
          this.user = res.data.list
        })
    }
  },
  mounted() {
  this.get_user()
  }
}
</script>

<style scoped>

</style>
